<%@ page import="com.psl.action.work.order.shippingDetails" %>
<%@ page import="com.psl.model.userlogin" %>
<%@ page import="com.psl.services.work.order.ShippingServices" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%
    userlogin userinfo = (userlogin) session.getAttribute("user");
    if (userinfo == null) {
        response.sendRedirect("/login.do");
    }
%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>shippingDetails</title>
    <link href="/assets/css/layout.css" rel="stylesheet" type="text/css">
    <style>
        body{
            font-size: 16px;
        }
    </style>
</head>

<body>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#AEDEF4">
    <tbody>
    <tr>
        <td height="25" colspan="18" align="center" bgcolor="#D6F2FD"><input name="itemid" type="hidden" id="itemid"
                                                                             value="">
            shipping details
        </td>
    </tr>
    <tr>
        <td align="center" bgcolor="#FFF9DF">编号</td>
        <td align="center" bgcolor="#FFF9DF">客户名称</td>
        <td height="25" align="center" bgcolor="#FFF9DF">报关单号</td>
        <td height="25" align="center" bgcolor="#FFF9DF">订单号</td>
        <td align="center" bgcolor="#FFF9DF">shipping Date</td>
        <td align="center" bgcolor="#FFF9DF">收汇日期</td>
        <td align="center" bgcolor="#FFF9DF">应收汇金额</td>
        <td align="center" bgcolor="#FFF9DF">未收汇金额</td>
        <td align="center" bgcolor="#FFF9DF">收汇差额</td>
        <td align="center" bgcolor="#FFF9DF">是否收汇</td>
        <td align="center" bgcolor="#FFF9DF">操作</td>
    </tr>
    <form action="/ShippingDetailAdd.do" method="post">
        <tr>
            <td align="center" bgcolor="#FFF9DF"></td>
            <td align="center" bgcolor="#FFF9DF">
                <select name="c_name">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                </select>
            </td>
            <td height="25" align="center" bgcolor="#FFF9DF"><input name="declaration_number" type="text" value=""/>
            </td>
            <td height="25" align="center" bgcolor="#FFF9DF"><input name="order_id" type="text" value=""></td>
            <td align="center" bgcolor="#FFF9DF"><input name="shippingdate" type="date" value=""></td>
            <td align="center" bgcolor="#FFF9DF"><input name="receipt_date" type="date" value=""></td>
            <td align="center" bgcolor="#FFF9DF"><input name="remittance_money" type="text" value=""></td>
            <td align="center" bgcolor="#FFF9DF"><input name="unremittance_money" type="text" value=""></td>
            <td align="center" bgcolor="#FFF9DF"><span id="a-b"></span>
            <td align="center" bgcolor="#FFF9DF">
            <input name="is_remoittance" type="radio" value="0"/>是<br>
            <input name="is_remoittance" type="radio" value="1"/>否
            </td>
            <td align="center" bgcolor="#FFF9DF">
                <input type="submit" name="button" value="保存">
            </td>
        </tr>
    </form>
    <%
        ShippingServices ss = new ShippingServices();
        List sd = ss.queryAllshipping();
        Iterator iter = sd.iterator();
        shippingDetails shd = null;
        int i = 0;
        while (iter.hasNext()) {
            i++;
            shd = (shippingDetails) iter.next();
    %>
    <tr>
        <td align="center" bgcolor="#FFF9DF"><%=i%>
        </td>
        <td align="center" bgcolor="#FFF9DF"><%=shd.getC_name()%>
        </td>
        <td height="25" align="center" bgcolor="#FFF9DF"><%=shd.getDeclaration_number()%>
        </td>
        <td height="25" align="center" bgcolor="#FFF9DF"><%=shd.getOrder_id()%>
        </td>
        <td align="center" bgcolor="#FFF9DF"><%=shd.getShippingdate()%>
        </td>
        <td align="center" bgcolor="#FFF9DF"><%=shd.getReceipt_date()%>
        </td>
        <td align="center" bgcolor="#FFF9DF"><%=shd.getRemittance_money()%>
        </td>
        <td align="center" bgcolor="#FFF9DF"><%=shd.getUnremittance_money()%>
        </td>
        <td align="center" bgcolor="#FFF9DF"><%=shd.getRemittance_money()-shd.getUnremittance_money()%>
        <td align="center" bgcolor="#FFF9DF">
            <%if (shd.getIs_remoittance() == 0) {%>
        <input  type="radio" value="0" checked/>是
            <%
                }
                if (shd.getIs_remoittance() == 1) {
            %>
        <input type="radio" value="1" checked/>否<%}%>
        </td>
        <td align="center" bgcolor="#FFF9DF">
        </td>
    </tr>
    <%}%>
    <tr>
        <td height="25" colspan="18" bgcolor="#FFFFFF">
            <input type="submit" name="button" value="导出xls">
        </td>
    </tr>
    </tbody>
</table>
</body>
</html>